import numpy as np
from sklearn.preprocessing import MinMaxScaler

matrix = np.array([[5, 10, 15], [20, 3, 30], [35, 40, 45]])
print(matrix[1:2, -2].reshape(-1, 1))

# 创建MinMaxScaler对象
scaler = MinMaxScaler()

# 进行归一化操作
normalized_matrix = scaler.fit_transform(matrix)

print("归一化后的矩阵：")
print(normalized_matrix)

# 进行反归一化操作
reversed_matrix = scaler.inverse_transform(normalized_matrix)

print("\n反归一化后的矩阵：")
print(reversed_matrix)
